package cn.lytcom.architecture.manager;

import android.os.Handler;
import android.os.HandlerThread;

/**
 * Created by lytcom on 2017/5/21.
 */

public class ThreadManager {

    private Handler handler;

    public ThreadManager() {
        init();
    }

    private void init() {
        HandlerThread handlerThread = new HandlerThread("ThreadManager");
        handlerThread.start();
        handler = new Handler(handlerThread.getLooper());
    }

    public boolean post(Runnable runnable) {
        return handler.post(runnable);
    }

    public boolean postDelayed(Runnable runnable, long delayMillis) {
        return handler.postDelayed(runnable, delayMillis);
    }
}
